package com.tinycloud.miracll.product.service.impl;

import java.util.Date;
import java.util.List;
import com.tinycloud.common.core.utils.DateUtils;
import com.tinycloud.common.datasource.annotation.Slave1;
import com.tinycloud.common.datasource.annotation.Slave3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tinycloud.miracll.product.mapper.ProductAuxisysWeighMainMapper;
import com.tinycloud.miracll.product.domain.ProductAuxisysWeighMain;
import com.tinycloud.miracll.product.service.IProductAuxisysWeighMainService;

/**
 * 自动助剂称量主Service业务层处理
 * 
 * @author tiny
 * @date 2022-05-24
 */
@Service
@Slave3
public class ProductAuxisysWeighMainServiceImpl implements IProductAuxisysWeighMainService
{
    @Autowired
    private ProductAuxisysWeighMainMapper productAuxisysWeighMainMapper;

    /**
     * 查询自动助剂称量主
     * 
     * @param id 自动助剂称量主主键
     * @return 自动助剂称量主
     */
    @Override
    public ProductAuxisysWeighMain selectProductAuxisysWeighMainById(String id) {
        return productAuxisysWeighMainMapper.selectProductAuxisysWeighMainById(id);
    }

    /**
     * 查询自动助剂称量主
     *
     * @param id 自动助剂称量主主键
     * @return 自动助剂称量主
     */
    @Override
    public Date getMaxWeighEndDate()
    {
        return productAuxisysWeighMainMapper.getMaxWeighEndDate();
    }

    /**
     * 查询自动助剂称量主列表
     * 
     * @param productAuxisysWeighMain 自动助剂称量主
     * @return 自动助剂称量主
     */
    @Override
    public List<ProductAuxisysWeighMain> selectProductAuxisysWeighMainList(ProductAuxisysWeighMain productAuxisysWeighMain) {
        return productAuxisysWeighMainMapper.selectProductAuxisysWeighMainList(productAuxisysWeighMain);
    }

    /**
     * 新增自动助剂称量主
     * 
     * @param productAuxisysWeighMain 自动助剂称量主
     * @return 结果
     */
    @Override
    public int insertProductAuxisysWeighMain(ProductAuxisysWeighMain productAuxisysWeighMain) {
        productAuxisysWeighMain.setCreateTime(DateUtils.getNowDate());
        return productAuxisysWeighMainMapper.insertProductAuxisysWeighMain(productAuxisysWeighMain);
    }

    /**
     * 修改自动助剂称量主
     * 
     * @param productAuxisysWeighMain 自动助剂称量主
     * @return 结果
     */
    @Override
    public int updateProductAuxisysWeighMain(ProductAuxisysWeighMain productAuxisysWeighMain) {
        productAuxisysWeighMain.setUpdateTime(DateUtils.getNowDate());
        return productAuxisysWeighMainMapper.updateProductAuxisysWeighMain(productAuxisysWeighMain);
    }

    /**
     * 批量删除自动助剂称量主
     * 
     * @param ids 需要删除的自动助剂称量主主键
     * @return 结果
     */
    @Override
    public int deleteProductAuxisysWeighMainByIds(String[] ids) {
        return productAuxisysWeighMainMapper.deleteProductAuxisysWeighMainByIds(ids);
    }

    /**
     * 删除自动助剂称量主信息
     * 
     * @param id 自动助剂称量主主键
     * @return 结果
     */
    @Override
    public int deleteProductAuxisysWeighMainById(String id) {
        return productAuxisysWeighMainMapper.deleteProductAuxisysWeighMainById(id);
    }
}
